package com.example.app.repository;

import com.example.app.entity.BodyEntry;
import org.springframework.data.jpa.repository.JpaRepository;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

public interface BodyEntryRepository extends JpaRepository<BodyEntry, Long> {
    List<BodyEntry> findByUserId(Long userId);

    Optional<BodyEntry> findByUserIdAndDate(Long userId, LocalDate date);

    List<BodyEntry> findTop7ByUserIdOrderByDateDesc(Long userId);

}
